<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        input {
            color: #999;
        }
    </style>
</head>
<body>
   <div>
    <input type="text" value="邮箱/ID/手机号">
    <input type="text" value="密码">
    <script>
        //获取元素
        var text = document.querySelector('input');
        text.onfocus=function(){
            if(this.value==="邮箱/ID/手机号"){
                this.value = '';
            }
            this.style.borderColor = 'pink';
        }
    </script>
   </div> 
</body>
</html>